<?php
/*
	插件概览
		
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'welcome';
if($_RQ['op']=='welcome'){
	//会员
	$member=array(
		'fee1'=>$this->count('feelog',array('merchid'=>$_SESSION['onemerchid'],'uniacid'=>$_SESSION['uniacid'],'type'=>0)),
		'fee3'=>$this->count('feelog',array('merchid'=>$_SESSION['onemerchid'],'uniacid'=>$_SESSION['uniacid'],'type'=>1)),
	);
	$return['htmls'][]=array('type'=>'data','one_num'=>6,'title'=>'奖励概况','datas'=>array(
		array('title'=>'积分奖励','num'=>1,'data'=>$member['fee1']),
		array('title'=>'金币奖励','num'=>1,'data'=>$member['fee3']),
	));
	//趋势
	$order_params=array(
		'title'=>'近30天奖励次数走势',
		'data'=>array(
			'tablename'=>$this->tablename('feelog'),
			'params'=>array('merchid'=>$_SESSION['onemerchid'],'uniacid'=>$_SESSION['uniacid']),
		),
	);
	$return['htmls'][]=model('core/echart')->line($order_params);
	$member_params=array(
		'title'=>'近三十天积分/金币增长走势',
		'data'=>array(
			'积分增长'=>array(
				'tablename'=>$this->tablename('feelog'),
				'params'=>array('merchid'=>$_SESSION['onemerchid'],'uniacid'=>$_SESSION['uniacid'],'type'=>0),
			),
			'金币增长'=>array(
				'tablename'=>$this->tablename('feelog'),
				'params'=>array('merchid'=>$_SESSION['onemerchid'],'uniacid'=>$_SESSION['uniacid'],'type'=>1),
			)
		),
	);
	$return['htmls'][]=model('core/echart')->line($member_params);
	set_html('title','奖励概况');
	exi($return);
}